import Vue from 'vue'
import Router from 'vue-router'
import Home from './pages/home.vue'

Vue.use(Router)

export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    { path: '/', name: 'home', component: Home },
    { path: '/syui', name: 'SyUi',  component: () => import('./pages/syui'), children: [
        // layout
        // { path: '/syui/layout', name: 'layout', component: () => import('./pages/ui/layout') },
        // navContainer
        { path: '/syui/wap', name: 'wap', redirect: '/syui/wap/navContainer', component: () => import('./pages/syui/wap'), children: [
          // 已被 UiRouterView 代替
          // { path: '/syui/wap/navContainer', name: 'navContainer', redirect: '/syui/wap/navContainer/demo1', component: () => import('./pages/syui/wap/navContainer'), children: [
          //   { path: '/syui/wap/navContainer/demo1', name: 'navContainerDemo1', component: () => import('./pages/syui/wap/navContainer/demo1') },
          //   { path: '/syui/wap/navContainer/demo2', name: 'navContainerDemo2', component: () => import('./pages/syui/wap/navContainer/demo2') },
          //   { path: '/syui/wap/navContainer/demo3', name: 'navContainerDemo3', component: () => import('./pages/syui/wap/navContainer/demo3') }
          // ]},
          { path: '/syui/wap/input', name: 'wapInput', component: () => import('./pages/syui/wap/input') },
          { path: '/syui/wap/swipe', name: 'wapSwipe', component: () => import('./pages/syui/wap/swipe') }
        ]},
        // pc
        { path: '/syui/pc', name: 'pc', redirect: '/syui/pc/json', component: () => import('./pages/syui/pc'), children: [
            { path: '/syui/pc/json', name: 'pcJson', component: () => import('./pages/syui/pc/json') },
            { path: '/syui/pc/device', name: 'pcDevice', component: () => import('./pages/syui/pc/device') }
          ]},
        // layout
        { path: '/syui/layout', name: 'layout', component: () => import('./pages/syui/layout') },
        // loadingBar
        { path: '/syui/loadingBar', name: 'loadingBar', component: () => import('./pages/syui/loadingBar') },
        // cascadeSelect
        { path: '/syui/cascadeSelect', name: 'cascadeSelect', component: () => import('./pages/syui/cascadeSelect') },
        // scroll
        { path: '/syui/scroll', name: 'scroll', component: () => import('./pages/syui/scroll') },
        // slide
        { path: '/syui/slide', name: 'slide', component: () => import('./pages/syui/slide') },
        // marqueeNotice
        { path: '/syui/marqueeNotice', name: 'marqueeNotice', component: () => import('./pages/syui/marqueeNotice') },
        // rollNotice
        { path: '/syui/rollNotice', name: 'rollNotice', component: () => import('./pages/syui/rollNotice') },
        // ToMask
        { path: '/syui/toMask', name: 'toMask', component: () => import('./pages/syui/toMask') },
        // Dialog
        { path: '/syui/dialog', name: 'dialog', component: () => import('./pages/syui/dialog'), children: [
            { path: '/syui/dialog/messageDialog', name: 'messageDialog', component: () => import('./pages/syui/dialog/messageDialog') },
            { path: '/syui/dialog/toastDialog', name: 'toastDialog', component: () => import('./pages/syui/dialog/toastDialog') },
            { path: '/syui/dialog/actionSheetDialog', name: 'actionSheetDialog', component: () => import('./pages/syui/dialog/actionSheetDialog') },
          ]
        },
        // Picker
        { path: '/syui/picker', name: 'picker', component: () => import('./pages/syui/picker'), children: [
            { path: '/syui/picker/datePicker', name: 'datePicker', component: () => import('./pages/syui/picker/datePicker') },
          ]
        },
        // Radio
        { path: '/syui/radio', name: 'Radio', component: () => import('./pages/syui/radio') },
        // Checkbox
        { path: '/syui/checkbox', name: 'Checkbox', component: () => import('./pages/syui/checkbox') },
        // Icon
        { path: '/syui/icon', name: 'Icon', component: () => import('./pages/syui/icon') },
        // BackTop
        { path: '/syui/backTop', name: 'BackTop', component: () => import('./pages/syui/backTop') },
        // ImgCropper
        { path: '/syui/imgCropper', name: 'ImgCropper', component: () => import('./pages/syui/imgCropper') }
    ]},
    { path: '/about', name: 'about', component: () => import('./pages/about.vue') }
  ]
})
